/**
 * 
 */
package YAPserver.gameObjects;

import java.util.Observable;

import YAPenvironment.YAPconstant;
import YAPserver.behaviours.BounceBehaviour;
import YAPserver.collisionEngine.GameObject;

/**
 * Abstract class for every gameObject. A gameObject is an object that is (at least for the gameLogic) a visible object in the Field. All gameObjects can
 * have intersections and have a middle point to define their position and a line used to work out collisions.
 * @see Line
 * @author Daniel
 * @author DMiagi
 *
 */

public abstract class AbstractGameObject extends Observable implements GameObject{
			public BounceBehaviour m_bounceBehaviour;
			
			protected static String tab = YAPconstant.C_SEPARATOR; 
			//MiddlePoint position of an Object
			protected Point m_middlePoint;
			//line used to work out if there was an intersection
			protected Line m_line;
			/**
			 * Sets how a ball will bounce off this gameObject.
			 * @param bounceBehaviour bounceBehaviour stating how a ball will bounce
			 */
			public void setBounceBehaviour(BounceBehaviour bounceBehaviour){
				m_bounceBehaviour = bounceBehaviour;
			}
			
			/**
			 * Sets this game object as hit. All observers are notified this gameObject has been hit.
			 */
			public void hasBeenHit(){
				this.setChanged();
			}
			
			public Point getMiddlePoint(){
				return m_middlePoint;
			}
			
			public Line getLine(){
				return this.m_line;
			}
			/**
			 * Returns the bounce behaviour this game object inflicts upon a ball.
			 * @return the bounce behaviour of this game object
			 */
			public BounceBehaviour getBounceBehaviour(){
				return this.m_bounceBehaviour;
			}
			
			public abstract void setMiddlePoint(Point point);
}
